(1) Field of the Invention
The present invention relates to a three-dimensional image processing apparatus for three-dimensional computer graphics to effect image generation in accordance with pictorial drawing instructions from a main CPU.
(2) Description of the Prior Art
Computer graphics (to be abbreviated as CG hereinbelow) is the technology for producing pictorial representation on a display from a result calculated and processed by a computer, so that it is possible to visualize a virtual world, or that which cannot be seen in the real world because this technology produces images electronically. Hence, CG can be used as a design tool in various industries such as architecture, electrical industry, machine engineering, etc., as well as a representation tool for scientific simulations and structural analysis. Further, since this technique is also used for production of TV programs and TV games, it has become more accessible to the general public. Recently, this has been attracting attention as a basic technique for virtual reality and multimedia.
Since three-dimensional CG handles an enormous amount of processing data, the data is not processed by only the main CPU (central processing unit) in the computer, but the imaging process is also effected by having dedicated hardware, such as a dedicated three-dimensional image processor, to achieve an improved processing speed. FIG. 1 shows a block diagram of a typical conventional three-dimensional image processor. This three-dimensional image processing system includes a main CPU 10 as a control operating unit, a main storage 12, a three-dimensional image processor 30 and a CRT 18 as a display device with a system bus 14 connecting main CPU 10, main storage 12 and three-dimensional image processor 30 to transfer data therebetween.
Three-dimensional image processor 30 includes a viewing transforming circuit 31, a texture processing circuit 32, a shading processing circuit 33, a pixel processing circuit 34 and an image memory and video control circuit 35.
Next, the overall operation of the three-dimensional image processing system will be described. The description is made with reference to FIG. 2 which is a flowchart showing the operation of the main CPU. Main storage 12 stores data for constituting the model and features of an object to be drawn in order to create a three-dimensional image of pictorial representation. This object is divided into polygons such as triangles, rectangles, etc., and for the vertexes constituting each polygon are data-formatted into coordinate values, colors, etc. This is stored as polygonal data in main storage 12.
Main CPU 10 reads out this polygonal data from main storage 12 via system bus 14 to execute the following processing according to software, or a three-dimensional image processing program. Based on the information as to the position of a viewpoint, direction of view and angle of the viewing which are given for drawing the image on the CRT screen, an eye coordinate system is set up by coordinate transformation (Step S21). After the display is cleared (Step S22), the polygonal data, i.e., the model data of an object is transformed into that in the eye coordinate system (Step S23) and subsequently, the texture environment is set up (Step S24). Setting up of the texture environment means the setting of two-dimensional images which are to be applied to the polygons. The polygonal data (including the texture data) thus transformed and designated is transferred to three-dimensional image processor 30 via system bus 14 (Step S25). At Step S26, it is checked if the polygonal data has been all transferred, and if the transfer has not yet ended, the operation is returned to Step S25, whereas if it is finished, the transmission will be stopped at Step S27. Then, main CPU 10 instructs three-dimensional image processor 30 to start picture drawing (Step S28).
The polygonal data sent to three-dimensional image processor 30 is converted into the two-dimensional coordinate data on the image frame and the data is subjected to various processing such as clipping, hidden-line/hidden-surface treatments. The data further undergoes an ambient lighting process for determining a model of an ambient light source and identifying its position. Next, images representing textures and patterns such as wood grain, etc. are mapped onto the polygons by means of texture processing circuit 32. In shading processing circuit 33, the surface expression of objects is created. Specifically, this process involves interpolation between neighboring pieces of color data at each vertex of polygons and creation of shadows on the surfaces of the polygons. Subsequently, pixel processing circuit 34 performs depth comparison in which when two or more objects overlap one another, their z-coordinate values (the z-axis is assumed to be the view direction) are compared so as to select the pixels which have been determined to be less distant. Further, a blending process for representing the transparency of an object is also performed. This image signal is once stored into the image memory and then displayed on the CRT by image memory and video control circuit 35.
Main CPU 10 checks if the program has been completed at Step S29, and if not, the operation is returned to Step S22, whereas if it is done, the operation is stopped.
In the above conventional processing scheme, in order to depict an object, the model data is converted into that in the eye coordinate system associated with the position of a viewpoint, the direction of view and the like. The thus converted data is transferred via system bus 14 to three-dimensional image processor 30 so as to be formed into the image. However, in accordance with this scheme, whenever the position of eye is changed, main CPU 10 has to effect a coordinate transformation and the converted model data must be transferred to three-dimensional image processor 30. In this way, since the model data constituting an object within the field of view is transferred to three-dimensional image processor 30 every time the position of viewpoint as well as the direction of view, etc. is changed, the load on system bus 14 with respect to the data transfer increases, lowering the processing rate of the whole system. Particularly, when the conventional system is applied to a virtual reality system in which the position of viewpoint, the direction of view and the like need to be changed very often, not only does the processing rate drop due to the aforementioned transfer load but also the processing other than that of the CG process cannot be executed.
For example, the transmission of one word (32 bits) through the system bus needs 30 nanoseconds. Since 49 words are need for each of the polygons, if polygonal data of ten thousand triangles is transferred, it takes 1470 nanoseconds (10,000.times.30 ns=1,470 ns). Every time the position of viewpoint and/or the direction of view is changed, the above-mentioned time is needed only for data transfer, and main CPU 10 needs additional time for effecting coordinate transformations etc. Accordingly, as the amount of data to be transferred increases, most of the capacity of the main CPU and the system bus is occupied by the CG processing.